package com.qianying.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;

/**
 * 结算方式实体类
 * 映射数据库中的settlement_method表
 */
@Data
@TableName("settlement_method")
@Schema(description = "结算方式实体类，存储不同结算方式的配置信息")
public class SettlementMethod {

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID，自增", example = "1")
    private Long id;

    @TableField("method_code")
    @Schema(description = "结算方式代码，唯一", required = true, example = "01")
    private String methodCode;

    @TableField("method_name")
    @Schema(description = "结算方式名称，唯一", required = true, example = "现结")
    private String methodName;

    @TableField("period_days")
    @Schema(description = "账期天数（0表示非账期）", example = "30")
    private Integer periodDays;

    @TableField("status")
    @Schema(description = "启用状态（0-禁用，1-启用）", example = "1")
    private Integer status;

    @TableField("description")
    @Schema(description = "结算方式描述", example = "订单完成后立即支付")
    private String description;

    @TableField("create_time")
    @Schema(description = "记录创建时间，自动生成", example = "2025-08-05T10:30:00")
    private Date createTime;

    @TableField("update_time")
    @Schema(description = "记录最后更新时间，自动更新", example = "2025-08-05T15:45:00")
    private Date updateTime;

    // 非数据库字段，用于状态名称展示
    @TableField(exist = false)
    @Schema(description = "状态名称（非数据库字段，用于显示）", example = "已启用")
    private String statusName;
}